/**
*  \file canmsg.h
*
*  \brief Generic interface for can messages
*
*  The definition of the can message should be made in way that is is optimized for the particular can c
*  All definitions will be made in the cfg file.
*
*  \author Michael J. Hohmann  michael.hohmann@linde-mh.de
*
*
*
*
*
*/
#ifndef CANMSG_H_INCLUDED
#define CANMSG_H_INCLUDED

/*================================================[ public includes  ]================================================*/
#include "../cfg/prj.h"
#include "../cfg/canmsg_cfg.h"
/*================================================[ public defines   ]================================================*/

/*================================================[ public datatypes ]================================================*/
enum node_states
{
   bootup                  =  0x00,
   stopped                 =  0x04,
   operational             =  0x05,
   pre_operational         =  0x7F,
   nmt_unknown             =  0xff

};


enum command_type
{
   stand_by                =  0x00,
   start_remote_node       =  0x01,
   stop_remote_node        =  0x02,
   enter_pre_operational   =  0x80,
   reset_node              =  0x81,
   reset_communication     =  0x82
};



/*abort code on BMS*/
typedef enum
{
	ABORT_CODE_OK						= 0x00000000,
	ABORT_CODE_COMMAND_UNKNOWN 			= 0x05040001,
	ABORT_CODE_UNSUPPORTED 				= 0x06010000,
	ABORT_CODE_READ_ONLY_WRITE 			= 0x06010001,
	ABORT_CODE_WRITE_ONLY_READ 			= 0x06010002,
	ABORT_CODE_OBJECT_NOT_EXIST			= 0x06020000,
	ABORT_CODE_DATA_TYPE_TOO_HIGH 		= 0x06070012,
	ABORT_CODE_DATA_TYPE_TOO_LOW 		= 0x06070013,
	ABORT_CODE_VALUE_RANGE_EXCEEDED 	= 0x06090030,
	ABORT_CODE_DATA_NOT_TRANSFERRED 	= 0x08000022
}SDO_ABORT_CODE;
/*================================================[ public variables ]================================================*/

/*================================================[ inline functions ]================================================*/

/*================================================[ public functions ]================================================*/

/*====================================================================================================================*/

#endif

/***********************************************************************************************************************
*                             Copyright 2018 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/
